from dataclasses import dataclass
from typing import Optional
from datetime import datetime

@dataclass
class User:
    user_id: Optional[int] = None
    nickname: str = ""
    email: str = ""
    phone_number: Optional[str] = None
    password_hash: Optional[str] = None

@dataclass
class Poem:
    poem_id: Optional[int] = None
    title: str = ""
    author_id: int = 0
    content: str = ""
    translation: Optional[str] = None
    annotation: Optional[str] = None
    appreciation: Optional[str] = None

@dataclass
class Author:
    author_id: int = 0
    name: str = ""
    dynasty: Optional[str] = None
    desc: Optional[str] = None

@dataclass
class Collection:
    collection_id: Optional[int] = None
    user_id: int = 0
    creation_time: Optional[datetime] = None
    desc: Optional[str] = None
    title: str = ""

@dataclass
class Tag:
    tag_id: Optional[int] = None
    name: str = ""
    desc: Optional[str] = None

@dataclass
class PoemTag:
    poem_id: int = 0
    tag_id: int = 0

@dataclass
class CollectionPoem:
    collection_id: int = 0
    poem_id: int = 0

@dataclass
class UserLikePoem:
    user_id: int = 0
    poem_id: int = 0
